<?php
class EnterAccountAction extends CommonAction {

    public function index()
    {
        $account = M('enter_account');
        $condition = array();

        if(!empty($_GET['stuff_date']))
            $condition['stuff_date'] = $this->_get('stuff_date');

        if(!empty($_GET['stuff_number']))
            $condition['stuff_number'] = $this->_get('stuff_number');

        parent::page($account->where($condition)->count());

        $accountData = $account->where($condition)
                               ->order('stuff_date desc')
                               ->limit($this->limit)
                               ->select();
        $this->assign(
            array(
                'accountData' => $accountData
            )
        );

        $this->display();
    }
}